<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./WEB-INF/templates/noBarTemplate.xhtml">
    
    <ui:define name="content">
        <h:outputStylesheet library="css" name="index.css"></h:outputStylesheet>
        <h:form id="loginForm">
            <p:remoteCommand name="redirect" action="#{loginBean.redirectIndex()}" process="@this" autoRun="true"></p:remoteCommand>
            <p:growl id="growl" showDetail="false" autoUpdate="true" life="4000" />
            <p:dialog header="#{messages.Error}" resizable="false" modal="true" visible="#{param.reason == 'expired'}">
                <h:outputText value="#{messages.SessionExpired}"></h:outputText>
            </p:dialog>
            <div class="allWidthHome colorBackground">
                <ul class="divSlider">
                    <li>
                        <div>
                            <span>#{messages.GetAJob}</span>
                        </div>
                    </li>
                    <li>
                        <div>
                            <span>#{messages.ShowWhatYouGot}</span>
                        </div>
                    </li>
                    <li>
                        <div>
                            <span>#{messages.Notsubscribe}</span>
                        </div>
                    </li>
                    <li>
                        <div>
                            <span>#{messages.ItsYourTime}</span>
                        </div>
                    </li>
                    <li>
                        <div>
                            <span>#{messages.Impress}</span>
                        </div>
                    </li>
                    <li>
                        <div>
                            <span>#{messages.ForgetCV}</span>
                        </div>
                    </li>
                </ul>
                <div class="divCara cara1"/>
                <div class="divCara cara2"/>
                <div class="divCara cara3"/>
                <div class="divCara cara4"/>
                <div class="divCara cara5"/>
                <div class="divCara cara6"/>
            </div>
            <div class="buttonHome registrar">
                <h:outputText styleClass="registrarPadding white" value="#{messages.JoinIn}">
                </h:outputText>
                <p:commandLink style="margin-top: 45px;font-size: 17px;" process="@this" action="/views/recruit/NewCandidate?faces-redirect=true" value="#{messages.NewCandidate}" styleClass="white uneteLabel"></p:commandLink>
                <!--<p:commandLink process="@this" action="/views/recruit/NewCompany?faces-redirect=true" value="#{messages.NewCompany}" styleClass="white uneteLabel"></p:commandLink>!-->
            </div>
            
            <div class="buttonHome identificar">
                <h:outputText styleClass="white identificarPadding" value="#{messages.Identify}"></h:outputText>
                <p:inputText styleClass="loginEmail" id="loginEmail" value="#{loginBean.email}" required="true" requiredMessage="#{messages.EmailRequired}" label="#{messages.Email}">  
                    <f:validator  binding="#{loginEmailValidator}"></f:validator>
                    <p:ajax event="change" update="growl" />
                </p:inputText> 
                <p:watermark for="loginEmail" value="#{messages.Email}" /> 
                <p:password styleClass="loginPassword" id="loginPassword" value="#{loginBean.password}" required="true" requiredMessage="#{messages.PasswordRequired}" label="#{messages.Password}">
                    <f:validateLength minimum="5" maximum="30"></f:validateLength>
                    <p:watermark for="loginPassword" value="#{messages.Password}" />
                </p:password>
                <p:commandLink process="@this" oncomplete="passwordRecoveryDialog.show()" actionListener="#{recoveryPasswordBean.reinitEmail()}" styleClass="forgot" value="#{messages.ForgotPassword}"></p:commandLink>
                <p:commandButton styleClass="loginButton" process="@parent" value="#{messages.LogIn}" update=":loginForm:growl" id="ajax" action="#{loginBean.logIn}" />
            </div>
            <div class="homeText">
                <h:outputText styleClass="homeTextTitle" value="#{messages.TheRecruiterySlogan}"></h:outputText>
                <h:outputText styleClass="homeTextBody" value="#{messages.TheRecruiteryMeetingText1}"></h:outputText>
                <h:outputText styleClass="homeTextBody" value="#{messages.TheRecruiteryMeetingText2}"></h:outputText>
                <h:outputText styleClass="homeTextBody" value="#{messages.TheRecruiteryMeetingText3}"></h:outputText>
                <h:outputText styleClass="homeTextBody" value="#{messages.TheRecruiteryMeetingText4}"></h:outputText>
            </div>

        </h:form>
        <h:form id="recoveryForm">
            <p:dialog id="passwordRecoveryDialog" widgetVar="passwordRecoveryDialog" header="#{messages.ForgotPassword}" resizable="false" modal="true">
                <p:panelGrid styleClass="noBorder noPadding noMargin" columns="1">
                    <p:inputText id="recoveryEmail" value="#{recoveryPasswordBean.email}">
                        <f:validator  binding="#{loginEmailValidator}"></f:validator>
                        <p:ajax event="change" update=":loginForm:growl" />
                    </p:inputText>
                    <p:watermark for="recoveryEmail" value="#{messages.Email}" />
                    <p:captcha label="Captcha" theme="white"></p:captcha>
                    <p:commandButton process="passwordRecoveryDialog"  update=":loginForm:growl" value="#{messages.Recover}" actionListener="#{recoveryPasswordBean.createRecovery()}"></p:commandButton>
                </p:panelGrid>
            </p:dialog>
        </h:form>
    </ui:define>

</ui:composition>
</html>